<?php

/**
 * sfShopCategory actions.
 *
 * @package    blog
 * @subpackage sfShopCategory
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class sfShopCategoryActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
      $this->shop_categorys = Doctrine_Core::getTable('ShopCategory')
      ->createQuery('a')
      ->execute();
  }
  
  public function executeShow(sfWebRequest $request)
  {
     $this->categories =  $this->getRoute()->getObject();
     $this->pager = new sfDoctrinePager(
    'ShopCategory',
    sfConfig::get('app_max_articles_by_category_page')
  );
  $this->pager->setQuery($this->categories->getProductsByCategoryQuery());
  $this->pager->setPage($request->getParameter('page', 1));
  $this->pager->init();
     
  }
  
}
